#include <d3dx9.h>
#include <MMSystem.h>

//#define ADD_LIGHT
#define D3DFVF_MYVERTEX		(D3DFVF_XYZ | D3DFVF_NORMAL)

struct MyVertex
{
	/*float			x, y, z;
	float			nx, ny, nz;*/

	//or
	D3DXVECTOR3		position;
	D3DXVECTOR3		normal;

};

class MyD3D  //: public L3DEngine
{

public:
	// Constructor & Destructor
	MyD3D();
	virtual ~MyD3D();


	// initializing
	HRESULT			InitD3D(HWND hWnd);
	void				ReleaseD3D();

	// Init data
	HRESULT			InitVB();
	

	// Rendering related
	HRESULT			Render();
	void				SetMatrices();
	void				SetLights();


protected:
	LPDIRECT3D9							lpd3d;
	LPDIRECT3DDEVICE9				lpd3ddevice;
	LPDIRECT3DVERTEXBUFFER9		lpVB;

	// matrix related
	D3DXMATRIXA16		matWorld;
	D3DXMATRIXA16		matView;
	D3DXMATRIXA16		matProj;

	// light related
	D3DMATERIAL9			mtrl;
	D3DLIGHT9				light;
	D3DLIGHT9				Pointlight;
};